package com.clarte.common.dao;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

public interface BaseDao<T, PK extends Serializable> {

	public void save(T t);

	public void delete(PK... pk);

	public void update(T t);

	public T get(PK pk);

	public List<T> findAll();

	public List<T> find(String hql, Object[] obj);

	public List<T> find(DetachedCriteria criteria);

	public List<T> findByCriteria(DetachedCriteria criteria, int firstResult,
			int maxResults);

	public List<T> find(String hql, Object[] param, int firstResult,
			int maxResults);

	public long getTotal(String hql);

	public long getTotal(String hql, Object[] obj);

	public long getTotal(DetachedCriteria criteria);

	public long getNextNum();

	public void executeUpdate(String hql, Object[] param);

}